﻿@model IRIS.Models.ContentIECategoriesViewModel

@{
    ViewBag.Title = "Edit";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

 @if (!ViewData.ModelState.IsValid)
 {
     <div class="error" >
        @Html.ValidationSummary(false)
    </div>
 }
 @if (Model.m_Content.News == true)
 {
     using (Html.BeginForm())
     {
         //We are going to trust the people who have access
         <fieldset>
            <legend>Breyta Frétt</legend>

            @Html.HiddenFor(m => m.m_Content.Alive)
            @Html.HiddenFor(m => m.m_Content.Approved)
            @Html.HiddenFor(m => m.m_Content.News)
            @Html.HiddenFor(m => m.m_Content.ID)
            @Html.HiddenFor(m => m.m_Content.CID)
            
            <div class="editor-label text">
                    Titill
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.m_Content.ContentTitle)
                
            </div>
            
            <div class="editor-label">
                Efni
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(m => m.m_Content.ContentText)
            </div>
           
            <p>
                <input type="submit" value="Breyta Frétt" />
            </p>
         </fieldset>
     }
 }
 else
 {
     using (Html.BeginForm())
     {
         //We are going to trust the people who have access
        <fieldset>
            <legend>Breyta grein</legend>

            @Html.HiddenFor(m => m.m_Content.Alive)
            @Html.HiddenFor(m => m.m_Content.Approved)
            @Html.HiddenFor(m => m.m_Content.News)
            @Html.HiddenFor(m => m.m_Content.ID)

            <div class="editor-label text">
                Titill
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.m_Content.ContentTitle)
            </div>

            <div>
                Stutt Lýsing
            </div>
            <div>
                @Html.TextAreaFor(m => m.m_Content.Description)
            </div>

            <div class="editor-label">
                Efni
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(m => m.m_Content.ContentText)
            </div>

            <div class="editor-label">
            Flokkur
            </div>
            <div class="editor-field">
                @Html.DropDownListFor(n => n.m_Content.CID, new SelectList(Model.m_Categories, "ID", "Name"))
            </div>   
            <p>
                <input type="submit" value="Breyta Grein" />
            </p>
        </fieldset>
     }
 }
